#pragma GCC optimize(2)
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define pi acos(-1.0)
#define e exp(1.0)
typedef pair<ll,ll> pa;
const ll INF=0x3f3f3f3f3f3f3f3f;
const ll maxn=1e5+7;
ll T,G,P;
int main()
{
//  freopen(".../.txt","w",stdout);
//  freopen(".../.txt","r",stdin);
	ios::sync_with_stdio(false);
	cin>>T;
	ll i,j,k;
	for(k=1;k<=T;k++){
		ll i,j,a,b,c;
		cin>>G>>P;
		cout<<"Team #"<<k<<endl;
		cout<<"Games: "<<G<<endl;
		cout<<"Points: "<<P<<endl; 
		cout<<"Possible records:"<<endl;
		for(a=P/3;a>=0;a--){
			b=P-3*a;
			c=G-a-b;
			if(a>=0&&b>=0&&c>=0)
			cout<<a<<'-'<<b<<'-'<<c<<endl;
		}
		cout<<endl;
	}
	return 0;
}
